package com.celesea.workflow.core.service;

import com.celesea.framework.service.BaseService;
import com.celesea.workflow.core.entity.WorkflowPermission;

import java.util.List;

/**
 * @author JackYuan
 * @create 2017-11-28 12:52
 */
public interface WorkflowPermissionService extends BaseService<WorkflowPermission> {

//    int doDeleteByDefine(String id);


    /**
     * 是否有统计授权
     *
     * @param workflowType
     * @return
     */
    boolean hasStatisticsPerm(Integer workflowType);


    /**
     * 是否有提交授权
     *
     * @param wfType
     * @return
     */
    boolean hasSubmitPerm(Integer wfType);

    /**
     * 是否有定义授权
     *
     * @param wfType
     * @return
     */
    boolean hasDefinePerm(Integer wfType);

    /**
     * 通过流程类型查询流程权限配置
     * @param workflowType
     * @return
     */
    List<WorkflowPermission> selectByWorkflow(Integer workflowType);

    /**
     * 保存流程权限
     * @param workflowType
     * @param workflowPermissions
     */
    void savePermission(Integer workflowType, List<WorkflowPermission> workflowPermissions);
}
